package com.zg.ktcomwan.simple

import androidx.paging.PagingDataAdapter
import com.zg.ktcomwan.adapter.TestAdapter
import com.zg.ktcomwan.fragment.AbsListFragment
import com.zg.ktcomwan.model.ArticleBean
import com.zg.ktcomwan.vm.ArticleVModel

/***
 * @Author:      zxd
 * @CreateDate:  2021/8/16 14:39
 * @Description:
 */
class RvListFragment : AbsListFragment<ArticleBean, ArticleVModel>() {
    override fun getAdapter(): PagingDataAdapter<ArticleBean, TestAdapter.ViewHolder> {
        return activity?.let { TestAdapter(it) }!!
    }

    //这里涉及到泛型的处理
    /*override fun getAdapter(): PagingDataAdapter<ArticleBean, RecyclerView.ViewHolder> {
        //var adapter = activity?.let { ArticleAdapter(it) }//ArticleAdapter是不行的，因为泛型的参数类型是不同的
        return TestAdapter()
    }*/
}